import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common'
import { ScrapService } from './scrap.service'

@Controller('scrap')
export class ScrapController {
  constructor(private readonly scrapService: ScrapService) { }

  @Post('add')
  add(@Body() body) {
    return this.scrapService.add(body)
  }

  @Post('del')
  del(@Body() body) {
    return this.scrapService.del(body.id as number)
  }

  @Post('edit')
  edit(@Body() body) {
    return this.scrapService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.scrapService.getPageList(body)
  }

  @Post('getScrapDetail')
  getScrapDetail(@Body() body) {
    return this.scrapService.getScrapDetail(body.code)
  }
}
